package cn.wolfcode.luowowo.mgrsite.controller;

import cn.wolfcode.luowowo.article.service.ITravelService;
import cn.wolfcode.luowowo.common.query.TravelQueryObject;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/travel")
public class TravelController {
    @Reference
    private ITravelService travelService;

    @RequestMapping("/list")
    public String list(@ModelAttribute("qo") TravelQueryObject qo, Model model) {
        model.addAttribute("pageInfo", travelService.query(qo));
        return "travel/list";
    }

    @RequestMapping("/getTravelContent")
    @ResponseBody
    public Object getTravelContent(Long id) {
        return travelService.getContent(id);
    }
}
